Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
update readme to include a better description of deploymen
  • Loading branch information
AlexanderHansson4225 authored Dec 10, 2023
1 parent 80189b8 commit a87677e
Showing 1 changed file with 40 additions and 3 deletions.
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,6 @@ port 80 being used...
service nginx stop





# Update Database models

The classes stored in the `Models` directory are the skeleton for the database. We use something called Code First to define our database structure in code relationships and then generate the database modifications automatically.
Expand Down Expand Up @@ -373,4 +370,44 @@ cat name_of_migration.sql | docker exec -i name_of_db_container psql -U nexpo
```


# Deploying and updating the Backend
The backend is currently hosted on AWS EC2 as three docker containers. Additionally, profile pictures and CVs are stored in AWS S3.

## Updating the Database
There are several ways that the database can be updated.

### Uploading via EC2
The most straightforward one being simply doing it in the EC2 instance. Since the database is hosted in EC2, PostgreSQLcommands can be used to update the database. If you have found the database… good. If not, go to EC2 and enter

```shell
docker exec -it <CONTAINER ID OF postgres:14> bash
```
```shell
psql -W nexpo -U nexpo
```
* Enter the password

### Uploading via python scripts
* In the folder ‘UploadToDB’ with a collection of python scripts and parsers that can be used to automate meticulous tasks. Note that some of them do not currently work, or work badly, as of IT22. (sorry)


## Updating the Backend
### Updating the backend endpoints
The backend currently running is available in Github at `/home/ec2-user/nexpo/nexpo-backend-nova`
It is updated by pulling the updated Github repo. The keys are (obviously) not in the Github repo, but should automatically be filled in. Make sure that this is the case. Also remember to migrate:

```shell
dotnet ef migrations script
dotnet ef database update
```

Then update the containers:

```shell
docker-compose -p nexpo build
docker-compose -p nexpo up -d
```

* This should create three docker containers (docker ps)


0 comments on commit a87677e

Please sign in to comment.