Skip to content

GitHub and Codespaces

API Logic Projects are standard, and so are their GitHb / IDE operations. A typical flow is illustrated below.

 

Create an API Logic Server Project

Create Project (here using Docker)
val@Vals-MBP-16 dockers % cd ~/dev/servers/install/ApiLogicServer/dockers; docker run -it --name api_logic_server --rm --net dev-network -p 5656:5656 -p 5002:5002 -v ${PWD}:/localhost apilogicserver/api_logic_server


Welcome to API Logic Server, 5.03.27

     $ printenv       for OS context       information -- Debian GNU/Linux 11 \n \l
     $ ApiLogicServer for API Logic Server information

api_logic_server@bc1bc88dc6ce:~$ ApiLogicServer create

Welcome to API Logic Server, 5.03.27

Project to create [/localhost/ApiLogicProject]: 
SQLAlchemy Database URI [default = nw.sqlite, ? for help]: 
... logging
api_logic_server@bc1bc88dc6ce:~$ exit  # exit, to facilitate use of Desktop tools (git cli, IDE, etc)

Save API Logic Project to GitHub

Create a project on your GitHub account (here called ApiLogicProject) in the usual manner.

  1. Create your project on GitHub
    *  Don't add files yet to avoid merge
    
    1. Exit the Docker container as shown above
    2. Initialize your project for git and push it in the usual manner:
Save Created API Logic Server Project to GitHub
git init
# git branch -m main
git add --all
git commit -m 'First commit'
git remote add origin https://github.com/valhuber/ApiLogicProject.git
git remote -v
git push origin main

Customize the Project

Use your IDE (or Code Editor) to customize the project. Standard GitHub operations are provided in most IDEs, and work with API Logic Server Projects.

Using your IDE

This is described under the Express Install.

Using Codespaces

CodeSpaces is a GitHub project that enables you to use VSCode in your Browser to develop on rapidly deployed docker containers. It's quite remarkable. It is entirely interoperable with VSCode operations on your local machine.

Here are some instructions you can use to explore API Logic Server running under CodeSpaces.

1. No signup required - use your GitHub account

2. Load the ApiLogicProject from GitHub

To access this GitHub project with Codespaces

  1. Open this page in a new window, and
  2. Click Open > Codespaces as shown below:

You will now see the sample project - running in VSCode, in the Browser. But that's just what you see...

Behind the scenes, Codespaces has requisitioned a cloud machine, and loaded your project - with a complete development environment - Python, your dependencies, git, etc.

You are attached to this machine in your Browser, running VSCode.

🏆 Pretty remarkable.

3. Add and Configure a Port

  • Referring to the diagram below, make the port public

4. Start the Server

  • Use the pre-defined Launch Configuration

5. Start the Browser

  • Click the globe, as shown above. This should start your Browser, and the links on the left (Customer etc) should return data.
If errors, use this procedure

The above procedure is simplified, based on some assumptions about Codespaces. If the Browser fails to launch, try the following for explicit specification of the forwarded port:

4. Configure the pre-created Codespaces-ApiLogicServer launch configuration (see above)

5. Start the Server using the provided Launch Configuration = Codespaces-ApiLogicServer

6. Open the Browser

Click the globe, as shown above. This should start your Browser, and the links on the left (Customer etc) should return data.