Giter Club home page Giter Club logo

inno-alumni-portal's People

Contributors

danielatonge avatar greendate avatar josebright avatar thesharpowl avatar

Stargazers

 avatar  avatar

Watchers

 avatar

inno-alumni-portal's Issues

Doesn't build

I followed the How to run section from the README.md and could not enter the platform.

TL;DR

It seems that main sources of errors are:

Back end

I tried installation using Python.

### Using Python
1. Open a shell/command line in this folder (better if it was after activating a python virtual env)
2. Install the needed python packages
```bash
pip install -r requirements.txt
```
3. Run the python script:
```bash
python3 main.py
```

And got an error:

python3: can't open file '~/gh/inno-alumni-portal/main.py': [Errno 2] No such file or directory

Next, I tried installation using Docker.

### Using docker
1. Here the image tag name is `alumni-backend` you can name it as you like
2. Also the port in docker is 8000 by default and locally you can map it to anything as you like
```bash
docker build -t alumni-backend
docker run -p 8000:8000 -d alumni-backend
```

I got an error.

"docker build" requires exactly 1 argument.
See 'docker build --help'.

Usage:  docker build [OPTIONS] PATH | URL | -

Build an image from a Dockerfile

Full app

docker-compose.yml

I tried docker compose.

docker compose -f docker-compose.yml up

I got an error.

Failed to load ~/Desktop/gh/inno-alumni-portal/.env: open ~/Desktop/gh/inno-alumni-portal/.env: no such file or directory

I created a .env following the Settings fields.

database_host: str
database_port: str
database_password: str
database_name: str
database_username: str
secret_key: str
algorithm: str
access_token_expire_minutes: str
mail_username: str
mail_password: str
mail_from: str
mail_port: str
mail_server: str
mail_from_name: str

# some random values
database_host="0.0.0.0"
database_port="5000"
database_password="abra"
database_name="foo"
database_username="bar"

# https://fastapi.tiangolo.com/advanced/security/oauth2-scopes/?h=secret_key#__tabbed_1_1
secret_key="09d25e094faa6ca2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7"
algorithm="HS256"
access_token_expire_minutes="30"

# https://github.com/sabuhish/fastapi-mail?tab=readme-ov-file#guide
mail_username="username"
mail_password="string"
mail_from="[email protected]"
mail_port="465"
mail_server="mail server"
mail_from_name="Alpha Beta"

Next, I ran docker compose again

docker compose -f docker-compose.yml up
WARN[0000] Found orphan containers ([nginx certbot]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. 
[+] Running 2/0
 ✔ Container inno-alumni-backend   Recreated                                                                              0.0s 
 ✔ Container inno-alumni-frontend  Recreated                                                                              0.0s 
Attaching to inno-alumni-backend, inno-alumni-frontend
inno-alumni-backend   | INFO:     Will watch for changes in these directories: ['/usr/src/app']
inno-alumni-backend   | INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
inno-alumni-backend   | INFO:     Started reloader process [1] using WatchFiles
inno-alumni-frontend  | 
inno-alumni-frontend  | > [email protected] next-dev
inno-alumni-frontend  | > next
inno-alumni-frontend  | 
inno-alumni-frontend  | 
inno-alumni-backend   | INFO:     Started server process [8]
inno-alumni-backend   | INFO:     Waiting for application startup.
inno-alumni-frontend  | ready - started server on 0.0.0.0:3000, url: http://localhost:3000
inno-alumni-frontend  | info  - Loaded env from /usr/src/app/.env
inno-alumni-frontend  | warn  - The `app` directory is experimental. To enable, add `appDir: true` to your `next.config.js` configuration under `experimental`. See https://nextjs.org/docs/messages/experimental-app-dir-config
inno-alumni-frontend  | warn  - The `app` directory is experimental. To enable, add `appDir: true` to your `next.config.js` configuration under `experimental`. See https://nextjs.org/docs/messages/experimental-app-dir-config
inno-alumni-backend   | {"is_panic":false,"message":"Server has closed the connection.","meta":null,"error_code":"P1017"}
inno-alumni-frontend  | event - compiled client and server successfully in 1142 ms (1315 modules)
inno-alumni-backend   | ERROR:    Traceback (most recent call last):
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
inno-alumni-backend   |     yield
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/backends/sync.py", line 94, in connect_tcp
inno-alumni-backend   |     sock = socket.create_connection(
inno-alumni-backend   |   File "/usr/local/lib/python3.9/socket.py", line 844, in create_connection
inno-alumni-backend   |     raise err
inno-alumni-backend   |   File "/usr/local/lib/python3.9/socket.py", line 832, in create_connection
inno-alumni-backend   |     sock.connect(sa)
inno-alumni-backend   | OSError: [Errno 99] Cannot assign requested address
inno-alumni-backend   | 
inno-alumni-backend   | During handling of the above exception, another exception occurred:
inno-alumni-backend   | 
inno-alumni-backend   | Traceback (most recent call last):
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
inno-alumni-backend   |     yield
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 218, in handle_request
inno-alumni-backend   |     resp = self._pool.handle_request(req)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 253, in handle_request
inno-alumni-backend   |     raise exc
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 237, in handle_request
inno-alumni-backend   |     response = connection.handle_request(request)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection.py", line 86, in handle_request
inno-alumni-backend   |     raise exc
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection.py", line 63, in handle_request
inno-alumni-backend   |     stream = self._connect(request)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection.py", line 111, in _connect
inno-alumni-backend   |     stream = self._network_backend.connect_tcp(**kwargs)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/backends/sync.py", line 94, in connect_tcp
inno-alumni-backend   |     sock = socket.create_connection(
inno-alumni-backend   |   File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
inno-alumni-backend   |     self.gen.throw(typ, value, traceback)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
inno-alumni-backend   |     raise to_exc(exc)
inno-alumni-backend   | httpcore.ConnectError: [Errno 99] Cannot assign requested address
inno-alumni-backend   | 
inno-alumni-backend   | The above exception was the direct cause of the following exception:
inno-alumni-backend   | 
inno-alumni-backend   | Traceback (most recent call last):
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/prisma/engine/query.py", line 194, in spawn
inno-alumni-backend   |     data = self.request('GET', '/status')
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/prisma/engine/http.py", line 114, in request
inno-alumni-backend   |     resp = self.session.request(method, url, **kwargs)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/prisma/_sync_http.py", line 25, in request
inno-alumni-backend   |     return Response(self.session.request(method, url, **kwargs))
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 821, in request
inno-alumni-backend   |     return self.send(request, auth=auth, follow_redirects=follow_redirects)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 908, in send
inno-alumni-backend   |     response = self._send_handling_auth(
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 936, in _send_handling_auth
inno-alumni-backend   |     response = self._send_handling_redirects(
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 973, in _send_handling_redirects
inno-alumni-backend   |     response = self._send_single_request(request)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1009, in _send_single_request
inno-alumni-backend   |     response = transport.handle_request(request)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 218, in handle_request
inno-alumni-backend   |     resp = self._pool.handle_request(req)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
inno-alumni-backend   |     self.gen.throw(typ, value, traceback)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
inno-alumni-backend   |     raise mapped_exc(message) from exc
inno-alumni-backend   | httpx.ConnectError: [Errno 99] Cannot assign requested address
inno-alumni-backend   | 
inno-alumni-backend   | The above exception was the direct cause of the following exception:
inno-alumni-backend   | 
inno-alumni-backend   | Traceback (most recent call last):
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 677, in lifespan
inno-alumni-backend   |     async with self.lifespan_context(app) as maybe_state:
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 566, in __aenter__
inno-alumni-backend   |     await self._router.startup()
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 656, in startup
inno-alumni-backend   |     handler()
inno-alumni-backend   |   File "/usr/src/app/app/main.py", line 34, in startup
inno-alumni-backend   |     db.connect()
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/prisma/client.py", line 263, in connect
inno-alumni-backend   |     self.__engine.connect(
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/prisma/engine/query.py", line 130, in connect
inno-alumni-backend   |     self.spawn(file, timeout=timeout, datasources=datasources)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/prisma/engine/query.py", line 213, in spawn
inno-alumni-backend   |     raise errors.EngineConnectionError(
inno-alumni-backend   | prisma.engine.errors.EngineConnectionError: Could not connect to the query engine
inno-alumni-backend   | 
inno-alumni-backend   | ERROR:    Application startup failed. Exiting.
inno-alumni-backend   | 
inno-alumni-backend   | db connected...
inno-alumni-frontend  | info  - Loaded env from /usr/src/app/.env
inno-alumni-frontend  | wait  - compiling...
inno-alumni-frontend  | event - compiled client and server successfully in 351 ms (1315 modules)
inno-alumni-frontend  | wait  - compiling / (client and server)...
inno-alumni-frontend  | event - compiled client and server successfully in 807 ms (2526 modules)
inno-alumni-frontend  | wait  - compiling /auth/login...
inno-alumni-frontend  | event - compiled client and server successfully in 292 ms (2541 modules)

Browser

Login page

In the browser, I got a login page.

image

Register page

I clicked on Register and got to the Register page.

image

After filling the fields, I clicked Continue and got to the Login page.

Login page (1)

I entered my new password.

image

I clicked Continue and got an error in the lower right corner of the page.

image

Innopolis University SSO

I clicked on Innopolis University SSO and was redirected to an /authorize page. There was an error.

image

Admin Login

I returned to the Login page.

image

I clicked on Admin login.

image

I kept the default values in the fields and clicked Continue. I got errors.

image

docker-compose-prod.yml

I changed the port mapping for the frontend service in docker-compose-prod.yml to 3000:80.

I ran docker compose on that file.

docker compose -f docker-compose-prod.yml up

I got these logs

[+] Running 3/0
 ✔ Container certbot               Running                                                                                0.0s 
 ✔ Container inno-alumni-backend   Created                                                                                0.0s 
 ✔ Container inno-alumni-frontend  Recreated                                                                              0.0s 
Attaching to certbot, inno-alumni-backend, inno-alumni-frontend, nginx
inno-alumni-frontend  | 
inno-alumni-frontend  | > [email protected] start
inno-alumni-frontend  | > next start -p 80
inno-alumni-frontend  | 
inno-alumni-frontend  | 
inno-alumni-backend   | INFO:     Started server process [1]
inno-alumni-backend   | INFO:     Waiting for application startup.
inno-alumni-frontend  | ready - started server on 0.0.0.0:80, url: http://localhost:80
inno-alumni-backend   | {"is_panic":false,"message":"Server has closed the connection.","meta":null,"error_code":"P1017"}
vnginx exited with code 1
inno-alumni-backend   | ERROR:    Traceback (most recent call last):
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
inno-alumni-backend   |     yield
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/backends/sync.py", line 94, in connect_tcp
inno-alumni-backend   |     sock = socket.create_connection(
inno-alumni-backend   |   File "/usr/local/lib/python3.9/socket.py", line 844, in create_connection
inno-alumni-backend   |     raise err
inno-alumni-backend   |   File "/usr/local/lib/python3.9/socket.py", line 832, in create_connection
inno-alumni-backend   |     sock.connect(sa)
inno-alumni-backend   | OSError: [Errno 99] Cannot assign requested address
inno-alumni-backend   | 
inno-alumni-backend   | During handling of the above exception, another exception occurred:
inno-alumni-backend   | 
inno-alumni-backend   | Traceback (most recent call last):
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
inno-alumni-backend   |     yield
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 218, in handle_request
inno-alumni-backend   |     resp = self._pool.handle_request(req)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 253, in handle_request
inno-alumni-backend   |     raise exc
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 237, in handle_request
inno-alumni-backend   |     response = connection.handle_request(request)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection.py", line 86, in handle_request
inno-alumni-backend   |     raise exc
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection.py", line 63, in handle_request
inno-alumni-backend   |     stream = self._connect(request)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection.py", line 111, in _connect
inno-alumni-backend   |     stream = self._network_backend.connect_tcp(**kwargs)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/backends/sync.py", line 94, in connect_tcp
inno-alumni-backend   |     sock = socket.create_connection(
inno-alumni-backend   |   File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
inno-alumni-backend   |     self.gen.throw(typ, value, traceback)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
inno-alumni-backend   |     raise to_exc(exc)
inno-alumni-backend   | httpcore.ConnectError: [Errno 99] Cannot assign requested address
inno-alumni-backend   | 
inno-alumni-backend   | The above exception was the direct cause of the following exception:
inno-alumni-backend   | 
inno-alumni-backend   | Traceback (most recent call last):
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/prisma/engine/query.py", line 194, in spawn
inno-alumni-backend   |     data = self.request('GET', '/status')
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/prisma/engine/http.py", line 114, in request
inno-alumni-backend   |     resp = self.session.request(method, url, **kwargs)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/prisma/_sync_http.py", line 25, in request
inno-alumni-backend   |     return Response(self.session.request(method, url, **kwargs))
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 821, in request
inno-alumni-backend   |     return self.send(request, auth=auth, follow_redirects=follow_redirects)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 908, in send
inno-alumni-backend   |     response = self._send_handling_auth(
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 936, in _send_handling_auth
inno-alumni-backend   |     response = self._send_handling_redirects(
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 973, in _send_handling_redirects
inno-alumni-backend   |     response = self._send_single_request(request)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1009, in _send_single_request
inno-alumni-backend   |     response = transport.handle_request(request)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 218, in handle_request
inno-alumni-backend   |     resp = self._pool.handle_request(req)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
inno-alumni-backend   |     self.gen.throw(typ, value, traceback)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
inno-alumni-backend   |     raise mapped_exc(message) from exc
inno-alumni-backend   | httpx.ConnectError: [Errno 99] Cannot assign requested address
inno-alumni-backend   | 
inno-alumni-backend   | The above exception was the direct cause of the following exception:
inno-alumni-backend   | 
inno-alumni-backend   | Traceback (most recent call last):
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 677, in lifespan
inno-alumni-backend   |     async with self.lifespan_context(app) as maybe_state:
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 566, in __aenter__
inno-alumni-backend   |     await self._router.startup()
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 656, in startup
inno-alumni-backend   |     handler()
inno-alumni-backend   |   File "/usr/src/app/app/main.py", line 34, in startup
inno-alumni-backend   |     db.connect()
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/prisma/client.py", line 263, in connect
inno-alumni-backend   |     self.__engine.connect(
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/prisma/engine/query.py", line 130, in connect
inno-alumni-backend   |     self.spawn(file, timeout=timeout, datasources=datasources)
inno-alumni-backend   |   File "/usr/local/lib/python3.9/site-packages/prisma/engine/query.py", line 213, in spawn
inno-alumni-backend   |     raise errors.EngineConnectionError(
inno-alumni-backend   | prisma.engine.errors.EngineConnectionError: Could not connect to the query engine
inno-alumni-backend   | 
inno-alumni-backend   | ERROR:    Application startup failed. Exiting.
inno-alumni-backend   | 
inno-alumni-backend   | db connected...
inno-alumni-backend exited with code 3
nginx exited with code 1

I opened the page in a browser.

image

I could not proceed to the platform. The errors for different buttons were the same as for docker-compose-yml.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.