- Overview
- Features
- Technologies
- Installation
- Usage
- Environment Variables
- Scripts
- API Reference
- Error Handling
- License
- Credits
- Contact
LinkUp Final Project is a full-stack web application built to facilitate user account management, event planning, and more. Users can register, log in, and engage with various functionalities based on their roles and permissions.
- User authentication and authorization using JSON Web Tokens (JWT)
- Event creation and management (Admin only)
- User profile management
- Real-time form validation and error handling
- Comprehensive error handling for server and client
- Toast notifications for enhanced user experience
This project leverages the following technologies:
- Front-end: React, Apollo Client, Vite, React Router, Material -
- Back-end: Node.js, Express.js, Apollo Server
- Database: MongoDB with Mongoose ORM
- Authentication: JWT for secure, token-based authentication
To view on Render, go to:
https://linkup-5oc1.onrender.com
Admin Login: email: test@email.com / password: password
Ensure you have the following installed:
- Node.js (v14 or later)
- MongoDB (locally or via a cloud provider like MongoDB Atlas)
-
Clone the repository:
git clone <htt>ps://github.com/rachelb36/linkup> cd linkup-final
-
Install dependencies for both server and client:
# Install server dependencies cd server npm install # Install client dependencies cd ../client npm install
-
Environment Configuration: Create a
.env
file in theserver
directory and add the following variables:PORT=3001 MONGODB_URI=<your_mongodb_connection_string> JWT_SECRET=<your_secret_key>
Replace <your_mongodb_connection_string> and <your_secret_key> with your actual MongoDB URI and a secret key for JWT.
Running the Application Start the development server: In the root directory, run
--IN the root directory, run:
`npm run dev`
Open your browser and navigate to http://localhost:3000 to access the application.
Sign up as a new user or log in if you already have an account. Admin users can access additional controls for event creation and management.
Make sure to configure the following environment variables in your .env file:
Variable Description PORT The port number for the server MONGODB_URI MongoDB connection string JWT_SECRET Secret key for signing JWT tokens Scripts
The following scripts are available in this project:
** Install dependencies:
bash
npm install
** Run the development server (in root directory):
bash
npm run dev
** Run client and server individually:
bash
** Start the development server:
** In the root directory, run:
bash
npm run dev
-- This command will concurrently start the server and client. The front-end will run on http://localhost:3000 and the back-end on http://localhost:3001.
Open your browser and navigate to http://localhost:3000 to access the application. ** User Authentication Sign up as a new user or login if you already have an account. Admin users can access additional controls for event creation and management.
Make sure to configure the following environment variables in your .env file:
Variable || Description PORT || The port number for the server MONGODB_URI || MongoDB connection string JWT_SECRET || Secret key for signing JWT tokens
The following scripts are available in this project:
bash
npm install
** Run the development server (in root directory): bash
npm run dev
Run client and se
npm install
The API supports the following endpoints and GraphQL queries/mutations:
Sign Up: Allows users to register with their details and get a JWT token. Login: Authenticates a user and returns a JWT token for further requests. Event Endpoints Add Event: Allows admin users to add events, including details such as name, location, date, and time. Update Event: Admins can modify existing events. Delete Event: Admins can delete events. Common Queries and Mutations
me: Returns details of the currently logged-in user. users: Returns a list of all users (admin-only access).
events: Retrieves a list of all events. event(id: ID!): Retrieves the details of a specific event by ID. User Mutations
signup(userInput: UserInput): Registers a new user. login(email: String!, password: String!): Logs in a user and returns a JWT token.
addEvent(input: EventInput!): Adds a new event (admin only). updateEvent(id: ID!, input: EventInput!): Updates an existing event (admin only). deleteEvent(id: ID!): Deletes an event (admin only). Error Handling
The application uses ErrorPage for handling unexpected issues in the client and custom GraphQL error handling in the back-end, with detailed error logging in the console.
signup(userInput: UserInput): Registers a new user. login(email: String!, password: String!): Logs in a user and returns a JWT token. Event Mutations
addEvent(input: EventInput!): Adds a new event (admin only). updateEvent(id: ID!, input: EventInput!): Updates an existing event (admin only). deleteEvent(id: ID!): Deletes an event (admin only).
The API supports the following endpoints and GraphQL queries/mutations:
Allows users to register with their details and get a JWT token. Login: Authenticates a user and returns a JWT token for further requests.
Allows admin users to add events, including details such as name, location, date, and time. ** Update Event: Admins can modify existing events. ** Delete Event: Admins can delete events.
** me: Returns details of the currently logged-in user. ** users: Returns a list of all users (admin-only access).
** events: Retrieves a list of all events. event(id: ID!): Retrieves the details of a specific event by ID.
signup(userInput: UserInput): Registers a new user. login(email: String!, password: String!): Logs in a user and returns a JWT token. Event Mutations
addEvent(input: EventInput!): Adds a new event (admin only). updateEvent(id: ID!, input: EventInput!): Updates an existing event (admin only).
deleteEvent(id: ID!): Deletes an event (admin only). Error Handling
The application uses ErrorPage for handling unexpected issues in the client and custom GraphQL error handling in the back-end, with detailed error logging in the console.
In the auth.js file, unauthorized access is managed by AuthenticationError using custom JWT validation. Any invalid tokens result in an appropriate error message.
The application uses ErrorPage for handling unexpected issues in the client and custom GraphQL error handling in the back-end, with detailed error logging in the console.
In the auth.js file, unauthorized access is managed by AuthenticationError using custom JWT validation. Any invalid tokens result in an appropriate error message.
** This project was accomplished with the help provided by the incredible instructors and TAs of the Rice University Coding Bootcamp, including Instructor Darian Mendez, Mateo Wallace, Mark Alfano, Gerard Mennella
This project is licensed under the MIT License. See the LICENSE file for more details.
For further questions or suggestions:
Email: rachel@pixelstreetmedia.com GitHub: github.com/rachelb36