Skip to content

anselmlong/nusphere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

127 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NUSphere

NUSphere is comprehensive, user-friendly web application that serves as a one-stop portal for all NUS-related events. Students can both publicise and find out events of their interests easily with the filter functions. Our goal is to simplify how events are shared, discovered, and managed, ensuring that no valuable opportunity for learning, networking, or socialising is missed.

Table of Contents

Prerequisites

Ensure you have the following installed:

  • Golang (>= 1.16)
  • Node.js (>= 14.x)
  • PostgreSQL (>= 12.x)
  • Git

Setup Instructions

Backend Setup

  1. Clone the repository:
    git clone https://github.com/anselmlong/nusphere.git
    cd nusphere/go-backend
    
  2. Install dependencies:
    go mod tidy
    
  3. Configure the environment variables: Create a .env file in the backend directory with the following content:
    DATABASE_URL=postgres://youruser:yourpassword@localhost:5432/yourdb?sslmode=disable
    
  4. Create the events, users and bookmarks table in PostgreSQL:
    CREATE TABLE events (
        id SERIAL PRIMARY KEY,
        title VARCHAR(255),
        date VARCHAR(50),
        description TEXT,
        image_url VARCHAR(255),
        type VARCHAR(50),
        price VARCHAR(50),
        organizer VARCHAR(100),
        start_time TIME,
        end_time TIME,
        registration_link VARCHAR(255),
        location VARCHAR(100),
        user_id INT REFERENCES users(id)
    );
    
    CREATE TABLE users (
        id SERIAL PRIMARY KEY,
        google_id VARCHAR(255) UNIQUE NOT NULL,
        name VARCHAR(255) NOT NULL,
        email VARCHAR(255) NOT NULL,
        password VARCHAR(255) NOT NULL,
    );
    
    CREATE TABLE bookmarks (
        id SERIAL PRIMARY KEY,
        user_id INT NOT NULL,
        event_id INT NOT NULL,
        FOREIGN KEY (user_id) REFERENCES users(id),
        FOREIGN KEY (event_id) REFERENCES events(id)
    );
    
  5. Run the backend server:
    go run main.go
    
    

Frontend Setup

  1. Install dependencies:
    npm install
    
  2. Run the frontend development server:
    npm start
    
    

Running the Application

  1. Start the backend server by running the command in the backend directory:
    go run main.go
    
  2. Start the frontend development server by running the command in the frontend directory:
    npm start
    
  3. Open your browser and navigate to http://localhost:3000 to view the application.

API Endpoints

GET /events: Retrieve all events.

POST /events: Create a new event.

PUT /events/: Update an existing event.

DELETE /events/: Delete an event.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Orbital project of Anselm Long and Yi Xhi

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors