-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ee7e15
commit defd3e1
Showing
1 changed file
with
63 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,83 @@ | ||
<p align="center"> | ||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a> | ||
</p> | ||
|
||
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 | ||
[circleci-url]: https://circleci.com/gh/nestjs/nest | ||
|
||
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p> | ||
<p align="center"> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a> | ||
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a> | ||
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a> | ||
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a> | ||
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a> | ||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a> | ||
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a> | ||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a> | ||
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a> | ||
</p> | ||
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer) | ||
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)--> | ||
# Toomio Backend | ||
|
||
## Description | ||
|
||
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. | ||
This repository contains the backend for the Toomio social media application. It is built using a modular monolithic architecture, providing a robust and scalable foundation for the Toomio platform. | ||
|
||
## Installation | ||
## Environment Variables | ||
|
||
```bash | ||
$ npm install | ||
Before running the application, make sure to set up the following environment variables in a `.env` file: | ||
|
||
``` | ||
MONGODB_URI= MongoDB connection string | ||
AWS_ACCESS_KEY_ID= AWS access key for authentication | ||
AWS_SECRET_ACCESS_KEY= AWS secret key for authentication | ||
AWS_REGION= AWS region where your resources are located | ||
AWS_COGNITO_USER_POOL_ID= Cognito User Pool ID for user management | ||
AWS_COGNITO_CLIENT_ID= Cognito Client ID for the application | ||
AWS_COGNITO_AUTHORITY= Base URL for Cognito authentication | ||
AWS_SQS_URL= Base URL for Amazon SQS queue | ||
``` | ||
|
||
## Running the app | ||
|
||
```bash | ||
# development | ||
$ npm run start | ||
|
||
# watch mode | ||
$ npm run start:dev | ||
## Running the Application | ||
|
||
# production mode | ||
$ npm run start:prod | ||
``` | ||
To run the Toomio backend, follow these steps: | ||
|
||
## Test | ||
1. Install dependencies: | ||
``` | ||
npm install | ||
``` | ||
|
||
```bash | ||
# unit tests | ||
$ npm run test | ||
2. Build the application: | ||
``` | ||
npm run build | ||
``` | ||
|
||
# e2e tests | ||
$ npm run test:e2e | ||
3. Start the server: | ||
``` | ||
npm run start | ||
``` | ||
|
||
# test coverage | ||
$ npm run test:cov | ||
``` | ||
## API Endpoints | ||
|
||
The Toomio backend provides the following main endpoints: | ||
|
||
- `/auth`: Handles user authentication and registration | ||
- POST `/register`: Register a new user | ||
- POST `/login`: Authenticate a user | ||
- POST `/change-password`: Change user password | ||
- POST `/forgot-password`: Initiate password reset | ||
- POST `/confirm-password`: Confirm password reset | ||
- GET `/search-users`: Search for users | ||
|
||
## Support | ||
- `/posts`: Manages social media posts | ||
- POST `/`: Create a new post | ||
- PUT `/edit/:smPostId`: Update an existing post | ||
- DELETE `/:smPostId`: Delete a post | ||
- PUT `/likepost`: Like a post | ||
- PUT `/commentpost`: Comment on a post | ||
- GET `/:smPostId/likes/count`: Get like count for a post | ||
- GET `/:smPostId/comments/count`: Get comment count for a post | ||
- GET `/:smPostId/comments`: Get comments for a post | ||
- GET `/user/:userEmail`: Get posts by a specific user | ||
|
||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). | ||
- `/journeys`: Handles user journeys | ||
- POST `/`: Create a new journey | ||
- PUT `/:journeyId`: Update an existing journey | ||
- DELETE `/:journeyId`: Delete a journey | ||
- GET `/user/:userEmail`: Get journeys for a specific user | ||
|
||
## Stay in touch | ||
- `/users`: Manages user-related operations | ||
- PUT `/follow`: Follow another user | ||
- GET `/:email/followers-count`: Get follower count for a user | ||
- GET `/:email/following-count`: Get following count for a user | ||
|
||
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com) | ||
- Website - [https://nestjs.com](https://nestjs.com/) | ||
- Twitter - [@nestframework](https://twitter.com/nestframework) | ||
- `/feed`: Retrieves user feed | ||
- GET `/`: Get the feed for the authenticated user | ||
|
||
## License | ||
- `/notifications`: Manages user notifications | ||
- GET `/`: Get notifications for the authenticated user | ||
|
||
Nest is [MIT licensed](LICENSE). | ||
Each endpoint is designed to handle specific functionalities of the Toomio social media platform, providing a comprehensive API for the frontend application. |