Future social media platform for teachers and students of TTPU.
This repository contains the source code of both the API and the web client of TwitturIn, structured as a monorepo.
The API is written with Express, with MongoDB as the database and Amazon S3 as the remote storage. The web client is a React single-page-application, with Redux for state management and RTK Query for connecting to the API. Styling is done with styled-components.
The application is running at https://twitturin.onrender.com.
- Node.js. You can either download directly from the official website, or use a tool like nvm. (Note: nvm is not available for Windows, but you might be interested in this alternative.)
- If you are on a Windows machine, you'll need to install cross-env as a dependency for the backend, and modify the npm scripts accordingly. See here for reference.
- As mentioned previously, TwitturIn API uses MongoDB and Amazon S3. The keys and links to connect to those are stored in environment variables. In the directory for the API, there is a sample file for the environment variables that need to be present to start the application. Please refer to the official docs of the respective services to see how to get started.
In the root of the repository, run the following:
npm install
This will install both the API and the client dependencies.
Start the API in development mode:
npm run dev:api
Start the client in development mode:
npm run dev:client
Build both the API and the client:
npm run build
Run unit tests and the API integration tests:
npm test
For end-to-end testing, the API and web client must both be running in the background:
npm run start:api
npm run start:client
Then, you can start the end-to-end tests:
npm run test:e2e
When the API is running in development mode (see Development), check the route /swagger for the documentation of the API endpoints.