gbowne1 / RadioLogger

A Radio Logging application build with NodeJS and ExpressJS
GNU General Public License v3.0
6 stars 7 forks source link

[TODO] Add API documentation #76

Open gbowne1 opened 1 year ago

gbowne1 commented 1 year ago

We have little to no API documentation for our APIs and their usage.

Create documentation for our API v1 and our Web API to the /docs and our Wiki which you can clone and edit separate from the repo.

Buddhika-Pathirathna commented 1 year ago

Interested, Can I have more details?

gbowne1 commented 1 year ago

@Buddhika-Pathirathna

You're welcome to write the API docs if you're interested.

What sort of information do you need?

Tarlsie commented 1 year ago

can you list the files where the api functions/ end points are, i am happy to work on some documentation.

jzunigarce commented 1 year ago

At night I can support you by providing that information

jzunigarce commented 1 year ago

@Tarlsie We currently have two applications in the project: the web application and the api. The web application is defined in the client folder, while the api is specified in the server folder. The routes for both applications are specified in the src/server/routes folder. The api endpoints are defined in the src/server/route/v1 folder. The SMBD we use is MongoDB.

Tarlsie commented 1 year ago

So for example in api/v1, in index, there is a function called use, with three different parameters that can be applied. Is that correct?

On Mon, 24 Jul 2023, 11:53 Jesús Antonio Zúñiga Arce, < @.***> wrote:

@Tarlsie https://github.com/Tarlsie We currently have two applications in the project: the web application and the api. The web application is defined in the client folder, while the api is specified in the server folder. The routes for both applications are specified in the src/server/routes folder. The api endpoints are defined in the src/server/route/v1 folder. The SMBD we use is MongoDB.

— Reply to this email directly, view it on GitHub https://github.com/gbowne1/RadioLogger/issues/76#issuecomment-1647492385, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWHFHNLPMFDHS2IICDZCE3XRYZY3ANCNFSM6AAAAAA2OAYJUY . You are receiving this because you were mentioned.Message ID: @.***>

jzunigarce commented 1 year ago

image The router módule is a function of express router In the api/v1, we define the endpoint. Each of these calls a module, for example the localhost:3001/api/v1/register/ call to module api/v1/register.route.js. Basically index.js is the entry point to call each module. image

Chizobaonorh commented 1 year ago

Hello if this project is still open i would love to contribute?

gbowne1 commented 1 year ago

Yes it's still open @Chizobaonorh

EdwinChukwuebuka commented 1 year ago

I'd love to help with the documentation too

gbowne1 commented 1 year ago

Ok @EdwinChukwuebuka @Chizobaonorh. Let me know if you would like to be assigned

Chizobaonorh commented 1 year ago

Ok @EdwinChukwuebuka @Chizobaonorh. Let me know if you would like to be assigned

Yes I would love to be assigned.

EdwinChukwuebuka commented 1 year ago

Yes I would

gbowne1 commented 1 year ago

Ok @Chizobaonorh @Tarlsie

Chizobaonorh commented 1 year ago

Ok @Chizobaonorh @Tarlsie

so how do i get started with this?

EdwinChukwuebuka commented 1 year ago

Yeah, is there any way we can discuss on the project and its feature outside of github, maybe discord or something so we can get started,cause github doesn't exactly have a massaging feature just commenting @gbowne1

EdwinChukwuebuka commented 1 year ago

@Chizobaonorh Hello

Chizobaonorh commented 1 year ago

@Chizobaonorh Hello

Hey, hello

Chizobaonorh commented 1 year ago

Yeah, is there any way we can communicate outside of github, maybe discord or something cause github doesn't exactly have a massaging feature just commenting

Which is convenient?

gbowne1 commented 1 year ago

@EdwinChukwuebuka @Chizobaonorh

I do not mind if you work on this together.

A quick follow up question, Do either of you have any experience in API's or documenting API's?

EdwinChukwuebuka commented 1 year ago

@Tarlsie Yes I do but looking to learn more hence why I'm contributing to helping with api documentation.

EdwinChukwuebuka commented 1 year ago

@gbowne1 I just need more information on the api to get started

gbowne1 commented 1 year ago

Thanks for being interested in this @EdwinChukwuebuka,

Alright, well, @jzunigarce did most of the API, so if you need help you can probably contact him.

There is a little bit of API information in the first 8 or so posts in this issue thread.

I prefer keeping conversation about this project on here. If you need anything in particular that is not an issue or bug, you can use the Discussion tab. I don't have any other means to communicate but I am able to respond fairly quickly if you need anything to help you.

We are mostly are using the API for login at the moment, it's not completely finished.

I would use Postman for reviewing the API.

The information on the API is spread all over the project repository.

You could also look in https://github.com/gbowne1/RadioLogger/tree/main/docs for other documentation.
I would clone/fork the Wiki https://github.com/gbowne1/RadioLogger.wiki.git by using git clone https://github.com/gbowne1/RadioLogger.wiki.git and place the documentation in an easily accessible manner, perhaps using a heading of API documentation.

Feel free to explore the project. Let me know if there are any missing bits of information that may be helpful.

EdwinChukwuebuka commented 1 year ago

Okay @gbowne1 Thanks for the information I'll help as much as I can :)

jzunigarce commented 1 year ago

Welcome @EdwinChukwuebuka , any questions I'd be happy to help you

EdwinChukwuebuka commented 1 year ago

@gbowne1 @jzunigarce is this api hosted?

gbowne1 commented 1 year ago

@EdwinChukwuebuka no it is not hosted anywhere. The express server does if you run the server. There is no external data service or API.

Theres an internal API for login and for the database.

EdwinChukwuebuka commented 1 year ago

@gbowne1 okay Just wanted to clarify

gbowne1 commented 1 year ago

Again, @jzunigarce can help answer questions. he did most of the API, the server, database connection, backend, etc. I primarily focus on the frontend. I haven't had time in the last 3-5 months to work on it.

Theres still a lot of work to do yet plus testing etc.

I welcome contributors to either end.

EdwinChukwuebuka commented 1 year ago

@jzunigarce @gbowne1 goodday Please I've been having a lot of issues running and testing the code Haven't really worked with node and express so I had to learn it these past 2 days, I've installed mongodb and also setup postman too but still having issues. I just need a guide on running the server and testing it on postman, so I can begin the documentation

gbowne1 commented 1 year ago

@EdwinChukwuebuka

What are you using for MongoDB?? MongoDB local, MongoDB Atlas or MongoDB Compass?

It should work fine in Postman.

The server itself is easy to run.

What are your issues running and testing the code?

All of our tests are in src/tests/unit

The documentation I wrote is pretty poor, sorry.

There are docs in here, also very poor. https://github.com/gbowne1/RadioLogger/tree/main/docs

The installation documentation here is not great either: https://github.com/gbowne1/RadioLogger/wiki/Installation

There's also some documentation in here https://github.com/gbowne1/RadioLogger/wiki

Chizobaonorh commented 1 year ago

@EdwinChukwuebuka

What are you using for MongoDB?? MongoDB local, MongoDB Atlas or MongoDB Compass?

It should work fine in Postman.

The server itself is easy to run.

What are your issues running and testing the code?

All of our tests are in src/tests/unit

The documentation I wrote is pretty poor, sorry.

There are docs in here, also very poor. https://github.com/gbowne1/RadioLogger/tree/main/docs

The installation documentation here is not great either: https://github.com/gbowne1/RadioLogger/wiki/Installation

There's also some documentation in here https://github.com/gbowne1/RadioLogger/wiki

Which is preferable to use for this project? Atlas or compass?

gbowne1 commented 1 year ago

All three work @Chizobaonorh It just comes down to preference. I use the cli version.

Chizobaonorh commented 1 year ago

All three work @Chizobaonorh It just comes down to preference. I use the cli version.

I am having a bit of issue with creating a MongoDB user with its id and username Create a MongoDB database called 'radiologger'

gbowne1 commented 1 year ago

Some instructions I found online, I just changed the database name

To create a database called radiologger in MongoDB Compass, follow these steps

To create a database called radiologger in MongoDB Atlas, follow these steps:

I think this is correct, I don't use either one so someone could update this and include this in the documentation.

Chizobaonorh commented 1 year ago

Some instructions I found online, I just changed the database name

To create a database called radiologger in MongoDB Compass, follow these steps

  • Open MongoDB Compass and connect to your MongoDB deployment. If you are using MongoDB Atlas, click "Database" in the top-left corner of Atlas, then click "Connect" for the database deployment you want to connect to.
  • Once connected, click the "Databases" tab in MongoDB Compass. This tab lists the existing databases for your MongoDB deployment.
  • Click the "Create Database" button to open the "Create Database" dialog.
  • In the "Create Database" dialog, enter the name of the database as "radiologger" and its first collection. Both the database name and the collection name are required.
  • Click "Create Database" to create the radiologger database and its first collection.

To create a database called radiologger in MongoDB Atlas, follow these steps:

  • Log in to MongoDB Atlas and navigate to the "Database Deployments" view.
  • Click "Connect" for the database deployment to which you want to connect.
  • In the Atlas Connect dialog, click "Connect with MongoDB Compass" to download or upgrade to the latest version of MongoDB Compass.
  • Install or upgrade MongoDB Compass as necessary.
  • Once MongoDB Compass is installed or upgraded, open it and connect to your MongoDB Atlas deployment using the connection details provided in the Atlas Connect dialog.
  • After connecting to your MongoDB Atlas deployment, follow the same steps as mentioned above for MongoDB Compass to create a database called radiologger.

I think this is correct, I don't use either one so someone could update this and include this in the documentation.

Thank you so much, let me try this out

gbowne1 commented 1 year ago

If you use/have installed mongod, mongo, mongosh, on the command line, it might be a bit easier.

I usually start mongod first. Then start the mongosh or mongo shell, either one works. once the shell is started then you can just do use radiologger, this will create the database radiologger.

Chizobaonorh commented 1 year ago

If you use/have installed mongod, mongo, mongosh, on the command line, it might be a bit easier.

I usually start mongod first. Then start the mongosh or mongo shell, either one works. once the shell is started then you can just do use radiologger, this will create the database radiologger.

it gave this error : No available formula with the name "mongod". Did you mean mono or mongosh?

gbowne1 commented 1 year ago

mongod is the MongoDB server for the cli version.

mongo and mongosh are the MongoDB shell. Either one works. I use mongosh.

Start the mongod server first by typing in mongod in your terminal/shell/command line/console.

Then start either mongo or mongosh.

gbowne1 commented 1 year ago

if you don't have mongod installed, and are using Atlas or Compass, it might be a different workflow. Again I don't use Atlas or Compass, so I couldnt help you there.

Chizobaonorh commented 1 year ago

mongod is the MongoDB server for the cli version.

mongo and mongosh are the MongoDB shell. Either one works. I use mongosh.

Start the mongod server first by typing in mongod in your terminal/shell/command line/console.

Then start either mongo or mongosh.

response for mongod: zsh: command not found: mongod i think i will just stick with mongosh

Chizobaonorh commented 1 year ago

if you don't have mongod installed, and are using Atlas or Compass, it might be a different workflow. Again I don't use Atlas or Compass, so I couldnt help you there.

ohh, what do you use?

gbowne1 commented 1 year ago

It really is sort of preference. I would suggest trying them all till you pick the one you like the best. I just find the cli version easier to use for me. But Atlas and Compass are the GUI version. I've never used them. So I installed mongosh, mongod and mongo (using apt on my system) so I can use the cli version and it works fine for me.

EdwinChukwuebuka commented 1 year ago

@gbowne1 Thank you for all your replies but I feel it'll be alot easier to setup a google meet even if it's an hour so we can get a better understanding of the project And also ask questions related to documentation I know you're a busy guy but this'll make this alot easy for you and us

gbowne1 commented 1 year ago

@EdwinChukwuebuka,

I considered setting up a Slack. which I might do, but it is really hard to keep conversations centralized. I will think about setting up something more central soon.

EdwinChukwuebuka commented 1 year ago

@gbowne1 Okay,As long as it's something you're comfortable with. But we should do it soon, so we can start with the documentation as soon as possible. So what date and time are we looking at?

gbowne1 commented 1 year ago

@EdwinChukwuebuka

I don't know I don't have a schedule. I do things as I have time for them.

I'm primarily focused on things in this order:

1) CodeBooker https://github.com/gbowne1/codebooker/ 2) MyBlog https://github.com/gbowne1/MyBlog 3) reactsocialmedia https://github.com/gbowne1/reactsocialnetwork 4) RadioLogger https://github.com/gbowne1/RadioLogger 5) spmssite https://github.com/gbowne1/spmssite (a website template in plain HTML/CSS/JS)

then after that whatever. 3) project kinda died. I wanna get CodeBooker into production before I do anything else. 3) needs to be revived.

gbowne1 commented 1 year ago

I renamed my old Slack, here's a invite:

https://join.slack.com/t/connectcoders/shared_invite/zt-23ajnvegn-0nUuIlxhSDU8tQrPBL~riQ

It was meant for reactsocialmedia, but I guess I really should have a central slack for all my projects.

This invite is only good for 30 days past this posting. Slack is free to use

EdwinChukwuebuka commented 1 year ago

@gbowne1 okay Since codebooker is the top priority right now, why don't we all focus on the documentation for that first then when we're done we finish up radiologger's

gbowne1 commented 1 year ago

I mean documentation for all of my project needs done, but, yes focusing on getting CodeBooker completed is priority.

I also want to focus on apps and projects that are more complete and have more of a following like reactsocialnetwork and codebooker, etc.

If you are a developer then its a good time to get in.